package org.example.leetcode;

/**
 * @author: lynn
 * @Descript: 两数之和
 * @date: 2021/7/11 13:10
 * @version: 1.0
 */
public class LC1 {

    public static void main(String[] args) {
        int[] nums={0,1,5,9};
        LC1 lc1=new LC1();
        int[] res= lc1.twoSum(nums,10);
        System.out.println("xxxx");

    }
    public  int[] twoSum(int[] nums, int target) {
        int[] res=new int[2];
        for (int i = 0; i <nums.length ; i++) {
            for (int j = i+1; j <nums.length ; j++) {
                if (nums[i]+nums[j]==target){
                    res[0]=i;
                    res[1]=j;
                    return res;
                }
            }
        }
        return res;
    }


}
